package org.zsl.controller.springmvc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.zsl.model.ResponseMsg;
import org.zsl.model.User;
import org.zsl.service.UserService;

import java.util.List;

//@Controller
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/login")
  //  @ResponseBody
     public ResponseMsg login(User user){

        System.out.println(user.getSuccess());

        return    userService.login3(user);

     }

    @RequestMapping("/list")
  //  @ResponseBody
    public List<User> list(){
        System.out.println("controller:list");
        return   userService.getList();
    }



}
